package launcher;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;

/**
 * Heap size: http://silentdevelopment.blogspot.fi/2010/03/how-to-set-or-increase-xmx-heap-memory.html
 * @author Arttu Viljakainen
 *
 */
public class StartAnotherJavaProgram {

	public boolean startProgram(String folder, String launcher) {

		try {

			String pathToJar = folder + File.separator + launcher;
			Process proc = Runtime.getRuntime().exec("java -Xmx512m -jar " + pathToJar);
			
			InputStream in = proc.getInputStream();
			InputStream err = proc.getErrorStream();

		} catch (IOException ioe) {
			ioe.printStackTrace();
		}
		return false;
	}

	public static void main(String[] args) {
//		new StartAnotherJavaProgram().startProgram();
	}
}
